Optimal. Leaf size=161 \[ \frac{2 a^3 c \tan (e+f x)}{d^2 f (c+d)}-\frac{a^3 (2 c-3 d) \tanh ^{-1}(\sin (e+f x))}{d^3 f}+\frac{2 a^3 (c-d)^{3/2} (2 c+3 d) \tanh ^{-1}\left (\frac{\sqrt{c-d} \tan \left (\frac{1}{2} (e+f x)\right )}{\sqrt{c+d}}\right )}{d^3 f (c+d)^{3/2}}-\frac{(c-d) \tan (e+f x) \left (a^3 \sec (e+f x)+a^3\right )}{d f (c+d) (c+d \sec (e+f x))} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.354823, antiderivative size = 274, normalized size of antiderivative = 1.7, number of steps used = 9, number of rules used = 9, integrand size = 31, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.29, Rules used = {3987, 98, 154, 157, 63, 217, 203, 93, 205} \[ \frac{2 a^3 c \tan (e+f x)}{d^2 f (c+d)}-\frac{2 a^4 (2 c-3 d) \tan (e+f x) \tan ^{-1}\left (\frac{\sqrt{a-a \sec (e+f x)}}{\sqrt{a (\sec (e+f x)+1)}}\right )}{d^3 f \sqrt{a-a \sec (e+f x)} \sqrt{a \sec (e+f x)+a}}-\frac{2 a^4 (c-d)^{3/2} (2 c+3 d) \tan (e+f x) \tan ^{-1}\left (\frac{\sqrt{c+d} \sqrt{a \sec (e+f x)+a}}{\sqrt{c-d} \sqrt{a-a \sec (e+f x)}}\right )}{d^3 f (c+d)^{3/2} \sqrt{a-a \sec (e+f x)} \sqrt{a \sec (e+f x)+a}}-\frac{(c-d) \tan (e+f x) \left (a^3 \sec (e+f x)+a^3\right )}{d f (c+d) (c+d \sec (e+f x))} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3987
Rule 98
Rule 154
Rule 157
Rule 63
Rule 217
Rule 203
Rule 93
Rule 205
Rubi steps
\begin{align*} \int \frac{\sec (e+f x) (a+a \sec (e+f x))^3}{(c+d \sec (e+f x))^2} \, dx &=-\frac{\left (a^2 \tan (e+f x)\right ) \operatorname{Subst}\left (\int \frac{(a+a x)^{5/2}}{\sqrt{a-a x} (c+d x)^2} \, dx,x,\sec (e+f x)\right )}{f \sqrt{a-a \sec (e+f x)} \sqrt{a+a \sec (e+f x)}}\\ &=-\frac{(c-d) \left (a^3+a^3 \sec (e+f x)\right ) \tan (e+f x)}{d (c+d) f (c+d \sec (e+f x))}+\frac{(a \tan (e+f x)) \operatorname{Subst}\left (\int \frac{\sqrt{a+a x} \left (a^3 (c-3 d)-2 a^3 c x\right )}{\sqrt{a-a x} (c+d x)} \, dx,x,\sec (e+f x)\right )}{d (c+d) f \sqrt{a-a \sec (e+f x)} \sqrt{a+a \sec (e+f x)}}\\ &=\frac{2 a^3 c \tan (e+f x)}{d^2 (c+d) f}-\frac{(c-d) \left (a^3+a^3 \sec (e+f x)\right ) \tan (e+f x)}{d (c+d) f (c+d \sec (e+f x))}-\frac{\tan (e+f x) \operatorname{Subst}\left (\int \frac{-a^5 (c-3 d) d-a^5 (2 c-3 d) (c+d) x}{\sqrt{a-a x} \sqrt{a+a x} (c+d x)} \, dx,x,\sec (e+f x)\right )}{d^2 (c+d) f \sqrt{a-a \sec (e+f x)} \sqrt{a+a \sec (e+f x)}}\\ &=\frac{2 a^3 c \tan (e+f x)}{d^2 (c+d) f}-\frac{(c-d) \left (a^3+a^3 \sec (e+f x)\right ) \tan (e+f x)}{d (c+d) f (c+d \sec (e+f x))}+\frac{\left (a^5 (2 c-3 d) \tan (e+f x)\right ) \operatorname{Subst}\left (\int \frac{1}{\sqrt{a-a x} \sqrt{a+a x}} \, dx,x,\sec (e+f x)\right )}{d^3 f \sqrt{a-a \sec (e+f x)} \sqrt{a+a \sec (e+f x)}}-\frac{\left (a^5 (c-d)^2 (2 c+3 d) \tan (e+f x)\right ) \operatorname{Subst}\left (\int \frac{1}{\sqrt{a-a x} \sqrt{a+a x} (c+d x)} \, dx,x,\sec (e+f x)\right )}{d^3 (c+d) f \sqrt{a-a \sec (e+f x)} \sqrt{a+a \sec (e+f x)}}\\ &=\frac{2 a^3 c \tan (e+f x)}{d^2 (c+d) f}-\frac{(c-d) \left (a^3+a^3 \sec (e+f x)\right ) \tan (e+f x)}{d (c+d) f (c+d \sec (e+f x))}-\frac{\left (2 a^4 (2 c-3 d) \tan (e+f x)\right ) \operatorname{Subst}\left (\int \frac{1}{\sqrt{2 a-x^2}} \, dx,x,\sqrt{a-a \sec (e+f x)}\right )}{d^3 f \sqrt{a-a \sec (e+f x)} \sqrt{a+a \sec (e+f x)}}-\frac{\left (2 a^5 (c-d)^2 (2 c+3 d) \tan (e+f x)\right ) \operatorname{Subst}\left (\int \frac{1}{a c-a d-(-a c-a d) x^2} \, dx,x,\frac{\sqrt{a+a \sec (e+f x)}}{\sqrt{a-a \sec (e+f x)}}\right )}{d^3 (c+d) f \sqrt{a-a \sec (e+f x)} \sqrt{a+a \sec (e+f x)}}\\ &=\frac{2 a^3 c \tan (e+f x)}{d^2 (c+d) f}-\frac{2 a^4 (c-d)^{3/2} (2 c+3 d) \tan ^{-1}\left (\frac{\sqrt{c+d} \sqrt{a+a \sec (e+f x)}}{\sqrt{c-d} \sqrt{a-a \sec (e+f x)}}\right ) \tan (e+f x)}{d^3 (c+d)^{3/2} f \sqrt{a-a \sec (e+f x)} \sqrt{a+a \sec (e+f x)}}-\frac{(c-d) \left (a^3+a^3 \sec (e+f x)\right ) \tan (e+f x)}{d (c+d) f (c+d \sec (e+f x))}-\frac{\left (2 a^4 (2 c-3 d) \tan (e+f x)\right ) \operatorname{Subst}\left (\int \frac{1}{1+x^2} \, dx,x,\frac{\sqrt{a-a \sec (e+f x)}}{\sqrt{a+a \sec (e+f x)}}\right )}{d^3 f \sqrt{a-a \sec (e+f x)} \sqrt{a+a \sec (e+f x)}}\\ &=\frac{2 a^3 c \tan (e+f x)}{d^2 (c+d) f}-\frac{2 a^4 (2 c-3 d) \tan ^{-1}\left (\frac{\sqrt{a-a \sec (e+f x)}}{\sqrt{a+a \sec (e+f x)}}\right ) \tan (e+f x)}{d^3 f \sqrt{a-a \sec (e+f x)} \sqrt{a+a \sec (e+f x)}}-\frac{2 a^4 (c-d)^{3/2} (2 c+3 d) \tan ^{-1}\left (\frac{\sqrt{c+d} \sqrt{a+a \sec (e+f x)}}{\sqrt{c-d} \sqrt{a-a \sec (e+f x)}}\right ) \tan (e+f x)}{d^3 (c+d)^{3/2} f \sqrt{a-a \sec (e+f x)} \sqrt{a+a \sec (e+f x)}}-\frac{(c-d) \left (a^3+a^3 \sec (e+f x)\right ) \tan (e+f x)}{d (c+d) f (c+d \sec (e+f x))}\\ \end{align*}
Mathematica [C] time = 4.05094, size = 455, normalized size = 2.83 \[ \frac{a^3 \cos (e+f x) \sec ^6\left (\frac{1}{2} (e+f x)\right ) (\sec (e+f x)+1)^3 (c \cos (e+f x)+d) \left (-\frac{2 i (2 c+3 d) (c-d)^2 (\cos (e)-i \sin (e)) (c \cos (e+f x)+d) \tan ^{-1}\left (\frac{(\sin (e)+i \cos (e)) \left (\tan \left (\frac{f x}{2}\right ) (c \cos (e)-d)+c \sin (e)\right )}{\sqrt{c^2-d^2} \sqrt{(\cos (e)-i \sin (e))^2}}\right )}{(c+d) \sqrt{c^2-d^2} \sqrt{(\cos (e)-i \sin (e))^2}}+\frac{d (c-d)^2 (c \sin (f x)-d \sin (e))}{c (c+d) \left (\cos \left (\frac{e}{2}\right )-\sin \left (\frac{e}{2}\right )\right ) \left (\sin \left (\frac{e}{2}\right )+\cos \left (\frac{e}{2}\right )\right )}+\frac{d \sin \left (\frac{f x}{2}\right ) (c \cos (e+f x)+d)}{\left (\cos \left (\frac{e}{2}\right )-\sin \left (\frac{e}{2}\right )\right ) \left (\cos \left (\frac{1}{2} (e+f x)\right )-\sin \left (\frac{1}{2} (e+f x)\right )\right )}+\frac{d \sin \left (\frac{f x}{2}\right ) (c \cos (e+f x)+d)}{\left (\sin \left (\frac{e}{2}\right )+\cos \left (\frac{e}{2}\right )\right ) \left (\sin \left (\frac{1}{2} (e+f x)\right )+\cos \left (\frac{1}{2} (e+f x)\right )\right )}+(2 c-3 d) (c \cos (e+f x)+d) \log \left (\cos \left (\frac{1}{2} (e+f x)\right )-\sin \left (\frac{1}{2} (e+f x)\right )\right )+(3 d-2 c) (c \cos (e+f x)+d) \log \left (\sin \left (\frac{1}{2} (e+f x)\right )+\cos \left (\frac{1}{2} (e+f x)\right )\right )\right )}{8 d^3 f (c+d \sec (e+f x))^2} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] time = 0.107, size = 548, normalized size = 3.4 \begin{align*} \text{result too large to display} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] time = 1.57318, size = 1891, normalized size = 11.75 \begin{align*} \text{result too large to display} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F] time = 0., size = 0, normalized size = 0. \begin{align*} a^{3} \left (\int \frac{\sec{\left (e + f x \right )}}{c^{2} + 2 c d \sec{\left (e + f x \right )} + d^{2} \sec ^{2}{\left (e + f x \right )}}\, dx + \int \frac{3 \sec ^{2}{\left (e + f x \right )}}{c^{2} + 2 c d \sec{\left (e + f x \right )} + d^{2} \sec ^{2}{\left (e + f x \right )}}\, dx + \int \frac{3 \sec ^{3}{\left (e + f x \right )}}{c^{2} + 2 c d \sec{\left (e + f x \right )} + d^{2} \sec ^{2}{\left (e + f x \right )}}\, dx + \int \frac{\sec ^{4}{\left (e + f x \right )}}{c^{2} + 2 c d \sec{\left (e + f x \right )} + d^{2} \sec ^{2}{\left (e + f x \right )}}\, dx\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] time = 1.30229, size = 444, normalized size = 2.76 \begin{align*} -\frac{\frac{2 \,{\left (2 \, a^{3} c^{3} - a^{3} c^{2} d - 4 \, a^{3} c d^{2} + 3 \, a^{3} d^{3}\right )}{\left (\pi \left \lfloor \frac{f x + e}{2 \, \pi } + \frac{1}{2} \right \rfloor \mathrm{sgn}\left (2 \, c - 2 \, d\right ) + \arctan \left (\frac{c \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) - d \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )}{\sqrt{-c^{2} + d^{2}}}\right )\right )}}{{\left (c d^{3} + d^{4}\right )} \sqrt{-c^{2} + d^{2}}} + \frac{4 \,{\left (a^{3} c^{2} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{3} - a^{3} c d \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{3} - a^{3} c^{2} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) - a^{3} d^{2} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )\right )}}{{\left (c \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{4} - d \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{4} - 2 \, c \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{2} + c + d\right )}{\left (c d^{2} + d^{3}\right )}} + \frac{{\left (2 \, a^{3} c - 3 \, a^{3} d\right )} \log \left ({\left | \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) + 1 \right |}\right )}{d^{3}} - \frac{{\left (2 \, a^{3} c - 3 \, a^{3} d\right )} \log \left ({\left | \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) - 1 \right |}\right )}{d^{3}}}{f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]